/*******************************************************************************
 * Copyright (c) 2008, 2009 Tapestry IDE Developers
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Tapestry IDE Developers - initial API and implementation
 *******************************************************************************/
package com.googlecode.tapestry.ide.internal.ui.navigator;

import com.googlecode.tapestry.ide.core.model.ITapestryContainer;
import com.googlecode.tapestry.ide.core.model.ITapestryItem;
import com.googlecode.tapestry.ide.core.model.ITapestryProject;

/**
 * The Class ProjectExplorerLabelProvider.
 */
public class ProjectExplorerLabelProvider extends
		AbstractNavigatorLabelProvider {

	/*
	 * (non-Javadoc)
	 * 
	 * @seecom.googlecode.tapestry.ide.internal.ui.navigator.
	 * AbstractNavigatorLabelProvider#getDescription(java.lang.Object)
	 */
	@Override
	public String getDescription(Object anElement) {
		// TODO Auto-generated method stub
		return super.getDescription(anElement);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.googlecode.tapestry.ide.ui.viewers.TapestryUILabelProvider#getText
	 * (java.lang.Object, java.lang.Object)
	 */
	@Override
	protected String getText(Object element, Object parentElement) {
		if (element instanceof ITapestryProject) {
			return "Tapestry Elements";
		}
		if (element instanceof ITapestryContainer<?>) {
			return ((ITapestryContainer<?>) element).getElementName();
		}
		if (element instanceof ITapestryItem) {
			ITapestryItem item = (ITapestryItem) element;
			return item.getElementName();

		}
		return super.getText(element, parentElement);
	}

}
